<!-- <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 100px;
            height: 63px;
            overflow: hidden;
            margin: 50px auto;
            border: 1px solid red;
            text-align: center;
        }
        ul{
            list-style: none;
        }
    </style>
</head>
<body>
    <div id="review_box">
        <ul id="comment1">
            <li>第1条</li>
            <li>第2条</li>
            <li>第3条</li>
            <li>第4条</li>
            <li>第5条</li>
            <li>第6条</li>
        </ul>
        <ul id="comment2"></ul>
    </div>
</body>

<script>
    window.onload = roll(50)
    function roll(t){
        var ul1 = document.getElementById("comment1");
        var ul2 = document.getElementById("comment2");
        var ulbox = document.getElementById("review_box");
        ul2.innerHTML = ul1.innerHTML;
        ulbox.scrollTop = 0; // 开始无滚动时设为0
        var timer = setInterval(rollStart, t); // 设置定时器，参数t用在这为间隔时间（单位毫秒），参数t越小，滚动速度越快
        ulbox.onmouseover = function () {
            clearInterval(timer);
        }
        ulbox.onmouseout = function () {
            timer = setInterval(rollStart, t);
        }

    }

    function rollStart() {
     // 上面声明的DOM对象为局部对象需要再次声明
     var ul1 = document.getElementById("comment1");
     var ul2 = document.getElementById("comment2");
     var ulbox = document.getElementById("review_box");
     // 正常滚动不断给scrollTop的值+1,当滚动高度大于列表内容高度时恢复为0
     if (ulbox.scrollTop >= ul1.scrollHeight) {
         ulbox.scrollTop = 0;
     } else {
         ulbox.scrollTop++;
     }
 }
</script>
</html> -->


<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
@-webkit-keyframes move {
0% {
top: 0;
}

100% {
top: -500px;
}
}

#wrap {
width: 100px;
height: 100px;
border: 1px solid #000;
position: relative;
margin: 100px auto;
overflow: hidden;
}

#list {
position: absolute;
left: 0;
top: 0;
margin: 0;
padding: 0;
-webkit-animation: 5s move infinite linear;
width: 200%;
}

#list li {
list-style: none;
width: 98px;
height: 98px;
border: 1px solid #fff;
background: #000;
color: #fff;
font: 50px/98px Arial;
text-align: center;
}

#wrap:hover #list {
-webkit-animation-play-state: paused;
}
</style>
</head>

<body>
<div id="wrap">
<ul id="list">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</div>
</body>

</html>